package com.ruoyi.nuclein.Feign;

import com.ruoyi.basicdata.domain.Resident;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.nuclein.Feign.Fallback.ResidentRallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;


import java.util.List;

@FeignClient(value = "ruoyi-basicdata", fallbackFactory = ResidentRallbackFactory.class)
public interface BasicDataFeign {

    /**
     *  根据楼栋id查询所有该楼栋人数
     * @param id
     * @return
     */
    @GetMapping("/resident/count/{id}")
    AjaxResult getCountByBuildId(@PathVariable("id") Long id);

    /**
     *  核酸任务发布的时候 修改楼栋状态
     */
    @PutMapping("/building/changeState/{id}")
    AjaxResult changeState(@PathVariable("id") Long id);

    /**
     *  根据楼栋Id查询住户信息
     */
    @GetMapping(value = "/resident/getResidentByBuildingId/{id}")
    List<Resident> getResidentByBuildingId(@PathVariable("id") Long id);

    /**
     * 根据住户id 修改状态为未检测
     * @param id
     */
    @PutMapping("/resident/batchState/{id}")
    AjaxResult updateBatchStateByBuildingId(@PathVariable("id") Long id);

    /**
     * 根据住户id 修改住户状态为已检测
     * @param id
     */
    @PutMapping("/resident/changeState/{residentId}")
    AjaxResult updateStateById(@PathVariable("residentId") Long id);

    @PutMapping("/building/taskChangeState/{ids}")
    AjaxResult taskChangeState(@PathVariable("ids") List<Long> ids);
}
